package org.example.clouddemo.recommend.feign;


import org.example.clouddemo.bean.common.entity.Product;
import org.example.common.response.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

// 1、定义一个接口 指定目标服务名和基础路径
@FeignClient(value = "service-product", path = "/api/admin/product")
public interface ProductFeignClient {
    // 2、对应服务主类Product 添加@EnableFeignClients注解
    @PostMapping("queryOne")
    ApiResult<Product> queryOne(@Validated @RequestBody Product param);


    @GetMapping("selectOrderByPriceDesc")
    ApiResult<List<Product>> selectOrderByPriceDesc();
}
